package com.foreknow.demo14;

/**
 * 讲 引用方法 的方法
 *
 */

public class Demo {
    public void methodA(String s) {
        System.out.println(s);
    }

    public void methodB(int a) {
        System.out.println(a);
    }

    public void methodC(Dog dog) {
        System.out.println(dog.getName());
    }

    public Dog methodD() {
        Dog dog = new Dog();
        dog.setName("abc");
        return dog;
    }

    public static void main(String[] args) {
        Demo demo = new Demo();
        demo.methodA("tom");
        demo.methodB(1);
        Dog dog = new Dog();
        dog.setName("tom");
        demo.methodC(dog);
        Dog dog1 = demo.methodD();
        System.out.println(dog1.getName());

    }
}